# app/models/base.py 示例
from sqlalchemy import BigInteger, Column, DateTime, Boolean
from sqlalchemy.ext.declarative import declarative_base
from datetime import datetime

class Base(declarative_base()):
    __abstract__ = True
    
    # 创建部门
    create_dept = Column(BigInteger, comment="创建部门")
    
    # 创建者
    create_by = Column(BigInteger, comment="创建者")
    
    # 创建时间
    create_time = Column(DateTime, default=datetime.utcnow, comment="创建时间")
    
    # 更新者
    update_by = Column(BigInteger, comment="更新者")
    
    # 更新时间
    update_time = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, comment="更新时间")
    
    # 删除标志
    is_del = Column(Boolean, default=False, comment="删除标志")